The present invention generally relates to recovery of execution of a computer program from hardware errors, and more particularly to compilation of program source code to support error recovery.
Checkpointing is a technique that is frequently used to recover a software application from a hardware failure. Checkpoints are established at selected points in the execution of the application. At each checkpoint, the state of selected data elements is saved along with a reference to the point in the program code at which the state was saved. In the event of a hardware failure, the most recent state of the checkpoint data can be restored and execution resumed at the point in the program following the checkpoint.
To provide checkpointing in a software application, the software developer is generally required to write the code that performs the checkpointing or make use of system-provided routines to perform the checkpointing. In either scenario, coding effort is required of the developer. For some applications, for example, transaction processing applications, it may be desirable for the developer to have close control over the checkpointing in the application. However, in other types of applications the developer may be less concerned with the exact points at which checkpoints are taken. Checkpointing code in the source file may also clutter the application code in applications where the developer is less concerned with checkpoint logic.
A system and method that address the aforementioned problems, as well as other related problems, are therefore desirable.
The present invention provides, in various embodiments, a compiler that identifies checkpoints in program code. Sets of data objects are associated with the checkpoints, and checkpoint code is generated by the compiler for execution at the checkpoints. The checkpoint code stores state information of the associated data objects for recovery if execution of the program is interrupted.
It will be appreciated that various other embodiments are set forth in the Detailed Description and Claims which follow.